Micron Document
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| SparkN0de-git | SparkN0de |
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


Commit 38b6f7651c6dc6f0f18379ed01e23925cc7b172f


Parents : 6aa7932
Author : Mark Qvist <mark@unsigned.io>
Date : 2021-12-10T18:36:18+01:00

Peer cleanup fix

Changes

1 files changed, 3 insertions(+), 2 deletions(-)

M LXMF/LXMF.py +3 -2

Diff

diff --git a/LXMF/LXMF.py b/LXMF/LXMF.py
index 040a551..e0b7b06 100644
--- a/LXMF/LXMF.py
+++ b/LXMF/LXMF.py
@@ -1566,8 +1566,9 @@ class LXMRouter:
for peer in culled_peers:
RNS.log("Removing peer "+RNS.prettyhexrep(peer)+" due to excessive unreachability", RNS.LOG_WARNING)
try:
- # TODO: Check this and add "if in" clause
- self.peers.pop(peer_id)
+ # TODO: Check this
+ if peer_id in self.peers:
+ self.peers.pop(peer_id)
except Exception as e:
RNS.log("Error while removing peer "+RNS.prettyhexrep(peer_id)+". The contained exception was: "+str(e), RNS.LOG_ERROR)


──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────